package com.woniuxy.store.core.mapper;

import com.woniuxy.store.core.model.MdSs;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author gmx
 * @since 2021-06-29
 */
public interface MdSsMapper extends BaseMapper<MdSs> {

    @Update("UPDATE `md_ss` SET `flag`=1 WHERE `ss_id`=#{ssId}")
    void delectOne(int ssId);

    @Update("UPDATE `md_ss` SET `flag`=CASE WHEN flag=0 THEN 1 ELSE 0 END WHERE `store_id`=#{storeId} and second_id=#{secondId}")
    void updateFlag(Integer storeId, Integer secondId);
}
